//
//  DYJContentsTableViewCell.m
//  Piece
//
//  Created by dllo on 16/6/6.
//  Copyright © 2016年 Northeast Dianli University. All rights reserved.
//

#import "DYJContentsTableViewCell.h"

@implementation DYJContentsTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor clearColor];

        self.titleLabel = [[UILabel alloc] init];
        self.titleLabel.textColor = [UIColor whiteColor];
        self.titleLabel.font = [UIFont systemFontOfSize:17];
        self.titleLabel.textAlignment = 1;
        [self.contentView addSubview:_titleLabel];
        
        self.authorLabel = [[UILabel alloc] init];
        self.authorLabel.textColor = [UIColor whiteColor];
        self.authorLabel.font = [UIFont systemFontOfSize:14];
        self.authorLabel.textAlignment = 1;
        [self.contentView addSubview:_authorLabel];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.titleLabel.frame = CGRectMake(0, 20, ScreenWidth, 30);
    self.authorLabel.frame = CGRectMake(0, self.titleLabel.frame.origin.y + self.titleLabel.frame.size.height, ScreenWidth, 20);
}
- (void)setModel:(DYJContentsModel *)model
{
    self.titleLabel.text = model.title;
    self.authorLabel.text = model.author;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
